package Thread;

public class Dom10 {
    public static void main(String[] args) throws InterruptedException {
        Thread t=new Thread(()->{
            for (int i = 0; i < 3; i++) {
                System.out.println("hello thread");
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
            System.out.println("t线程结束");
        });
        t.start();
        //在main进程当中让t进程在main进程之前结束
        t.join();
        System.out.println("main进程结束");
    }
}
